﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace DARE.Save.DataStructures
{
    public class CSkyPlaneData : ASkyData
    {
        string Texture;

        public override void FillDataStructure(object sky)
        {
            base.FillDataStructure(sky);
            CSkyPlane skyPlane = sky as CSkyPlane;
            Texture = CResourceMgr.GetResourceName(skyPlane.Texture);
        }

        public override void FillFromDataStructure(out object sky, params object[] paramsData)
        {
            sky = null;
            if (!(paramsData.Length > 0 && paramsData[0] is CSkyMgr))
                return;
            sky = (paramsData[0] as CSkyMgr).CreateSkyPlane(Name, DARE.CResourceMgr.Load<Texture2D>(Texture));
            //(sky as CSkyPlane).Name = Name;
        }
    }
}
